#
import unittest as ut
import cv2
from adb_robot.utils import find_img, load_img
from adb_robot.actions import adb_action_find_img


class TestAll(ut.TestCase):

    def testFindImg(self):
        target = load_img('./data/test/test_target.png')
        image = load_img('./data/test/test.png')
        self.assertEqual((302, 626), find_img(target, image))
        self.assertEqual((302, 626), find_img(target, image, crop = (240, 560, 360, 700)))
        target = load_img('./data/test/test_target_bw.png')
        self.assertEqual(None, find_img(target, image))

    def notestScreenCap(self):
        result = adb_action_find_img('./data/test/test_target.png')
        self.assertEqual((302, 626), result)


if __name__ == "__main__":
    ut.main()
